package com.commands
{
	import com.adobe.cairngorm.control.CairngormEvent;
	import com.adobe.cairngorm.commands.Command;
	import mx.controls.Alert;
	import com.model.ModelLocator;
	import flash.events.Event;
	import com.events.ChangeJornadaEvent;
	import com.events.CargarEvent;
	import com.controller.Controller;
	import com.adobe.cairngorm.control.CairngormEventDispatcher;


	public class ChangeJornadaCommand implements Command
	{
		private var modelLocator : ModelLocator = ModelLocator.getInstance();
		
		public function execute(event:CairngormEvent):void
		{
	        var changeJornadaEvent:ChangeJornadaEvent = ChangeJornadaEvent(event);  
	        var selectedItem:Object = changeJornadaEvent.selectedItem;
	        
	        modelLocator.selectedItem = selectedItem;
	        modelLocator.link = "http://62.22.102.31/PROYECTO_LAE/quiniela_actualizar.aspx?p1=1&p2=2006&p3=" + String(modelLocator.selectedItem);

	        var eventCargar:CargarEvent = new CargarEvent(Controller.EVENT_CARGAR);
			CairngormEventDispatcher.getInstance().dispatchEvent(eventCargar);	        
		}
		
	}
}